#include  "board.h"
#include <motor.h>
#include <servos.h>
#include <exit.h>
#include <apds9960.h>



void board_init(void)
{
    NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
    SystemCoreClockUpdate();
    Delay_Init();

	motor_init();       //初始化电机参数
	servos_init();      //舵机初始化

    exti0_int_init();   	//初始化外部中断0
    USART_Printf_Init( 9600 );    //串口波特率
    Delay_Ms(10);

	SparkFun_APDS9960();//初始化一些变量为0
	printf("SparkFun APDS-9960 - GestureTest\r\n");
	Delay_Ms(10);
	//初始化APDS9960  读取器件ID    失能all   对getsure寄存器设置默认值
	if(SparkFun_APDS9960_init())
	{
		printf("APDS-9960 initialization complete\r\n");
	}
	else
	{
		printf("Something went wrong during APDS-9960 init!\r\n");
	}
	Delay_Ms(10);
	if (enableGestureSensor(true) )
	{
		printf("Gesture sensor is now running\n");
	}
	else
	{
		printf("Something went wrong during gesture sensor init!\n");
	}
	Delay_Ms(10);
}

